package com.xmb.wechat.delegate;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xmb.wechat.R;
import com.xmb.wechat.baserecyclerview.BaseRecyclerViewManager;
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration;

import java.util.ArrayList;

/**
 * @Author lijiangop
 * @CreateTime 2020/4/17 10:48
 */
public class BankListDelegate extends BaseRecyclerViewManager {

    public BankListDelegate(Context context, RecyclerView recyclerView) {
        super(context, recyclerView);
    }

    @Override
    public BaseQuickAdapter initAdapter() {
        return new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_bank_card_add, new ArrayList<>()) {
            @Override
            protected void convert(BaseViewHolder helper, String item) {
                helper.setText(R.id.tv_content, item);
            }
        };
    }

    @Override
    protected RecyclerView.ItemDecoration getItenDecoration() {
        return new HorizontalDividerItemDecoration.Builder(context).size(SizeUtils.dp2px(1f)).color(ContextCompat.getColor(context, R.color.black_05)).build();
    }
}
